package stage1.operation.module2;

import java.math.BigDecimal;

public class Test {
    public static void main(String args[]) {
        check("18709292182", "张三", 1000.00, 50.00, 8, 70, 500);
        check("18709292188", "李四", 800.00, 60.00, 12, 20, 300);
        check("18709292199", "王五", 2000.00, 20.00, 15, 50, 100);
    }

    public static void check(
            String phoneNumber,
            String name,
            double balanceD,
            double monthlyTariffD,
            int smsNumber,
            int callDuration,
            int internetTraffic
    ) {
        System.out.println("通话服务接口-" + phoneNumber + "---------------");
        CallPackage cp = new CallPackage();
        SimCard sc = new SimCard();
        sc.setPhoneNumber(phoneNumber);
        sc.setUsername(name);
        BigDecimal balance = new BigDecimal(balanceD);
        sc.setBalance(balance);
        sc.displayAccount();
        sc.setInternetTraffic(internetTraffic);
        sc.setCallDuration(callDuration);

        BigDecimal monthlyTariff = new BigDecimal(monthlyTariffD);
        cp.setMonthlyTariff(monthlyTariff);
        cp.setSmsNumber(smsNumber);
        cp.displayPackage(sc.getCallDuration(), sc);

        System.out.println("上网服务接口-" + phoneNumber + "---------------");
        InternetPackage ipa = new InternetPackage();
        ipa.setInternetTraffic(sc.getInternetTraffic());
        ipa.setMonthlyTariff(monthlyTariff);

        ipa.displayPackage(sc.getCallDuration(), sc);
        sc.displayAccount();

        System.out.println();
        System.out.println();
    }
}
